<template>
  <a-modal v-model="visible" :footer="null" title="腾讯物流查询" width="45%">
    <a-spin :spinning="confirmSpin">
      <a-form-model
        ref="form"
        :model="configData"
        :rules="rules"
        :label-col="labelCol"
        :wrapper-col="wrapperCol">
        <a-form-model-item label="url" prop="url">

          <a-input v-model="configData.url"
                   placeholder="https://service-ohohpvok-1300683954.gz.apigw.tencentcs.com/release/express"
                   :style="{color:'black'}"
                   disabled/>
        </a-form-model-item>

        <a-form-model-item label="source" prop="source">
          <a-input v-model="configData.source" placeholder="market" :style="{color:'black'}"
                   disabled/>
        </a-form-model-item>

        <a-form-model-item label="secretId" prop="secretId">
          <a-input v-model="configData.secretId" placeholder="等待您填写secretId" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="secretKey" prop="secretKey">
          <a-input v-model="configData.secretKey" placeholder="等待您填写secretKey" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item :wrapper-col="{ span: 14, offset: 7 }" v-if="!disable">
          <a-button type="primary" style="width:100px;" @click="onSubmit">
            修改
          </a-button>
          <a-button style="margin-left: 20px;width:100px;" @click="resetForm">
            重置
          </a-button>
        </a-form-model-item>

      </a-form-model>
    </a-spin>
  </a-modal>
</template>
<script>
import {getAction, putAction} from "@/api/manage";
import {BoneCommonMixin} from "@/mixins/BoneCommonMixin";
import {ConfigDictMixins} from "@views/gospel/configCenter/mixins/ConfigDictMixins";

export default {
  name: "TxLogisticsModal",
  mixins: [BoneCommonMixin, ConfigDictMixins],
  components: {},
  data() {
    return {
      description: "腾讯物流配置",
      labelCol: {span: 4},
      wrapperCol: {span: 20},
      rules: {
        secretId: [
          {required: true, message: '请输入secretId', trigger: 'blur'},
          {min: 3, message: '请输入3个字符以上', trigger: 'blur'},
        ],
        secretKey: [
          {required: true, message: '请输入secretKey', trigger: 'blur'},
          {min: 3, message: '请输入3个字符以上', trigger: 'blur'},
        ],
        url: [
          {required: true, message: '请输入url', trigger: 'blur'},
          {
            validator: (rule, value, callback) => this.validatePass(rule, value, callback, "https://service-ohohpvok-1300683954.gz.apigw.tencentcs.com/release/express"),
            trigger: 'blur'
          },
        ],
        source: [
          {required: true, message: '请输入source', trigger: 'blur'},
          {
            validator: (rule, value, callback) => this.validatePass(rule, value, callback, "market"),
            trigger: 'blur'
          },
        ],

      },
      type: "tencentLogistics",
      configData: {
        url: "https://service-ohohpvok-1300683954.gz.apigw.tencentcs.com/release/express",
        source: "market",
        secretId: "",
        secretKey: "",
      },
      url: {
        configUpdate: "/config/logistics/tencent",
      },
    }
  },
}
</script>

<style scoped>

</style>